using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Transpose Time Fields</para>
    /// <para>Shifts fields from columns to rows in a table or feature class that have time as the field names. This tool is useful when your table or feature class stores time in field names (such as Pop1980, Pop1990, Pop2000, and so on), and you want to create time stamps for the feature class or table so that it can be animated through time.</para>
    /// <para>将字段从列移动到表或要素类中以时间作为字段名称的行。当您的表或要素类将时间存储在字段名称（例如 Pop1980、Pop1990、Pop2000 等）中，并且您希望为要素类或表创建时间戳以便可以随时间进行动画处理时，此工具非常有用。</para>
    /// </summary>    
    [DisplayName("Transpose Time Fields")]
    public class TransposeTimeFields : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TransposeTimeFields()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Feature_Class_or_Table">
        /// <para>Input Feature Class or Table</para>
        /// <para>The input feature class or table for which time stamps will be created.</para>
        /// <para>将为其创建时间戳的输入要素类或表。</para>
        /// </param>
        /// <param name="_Fields_to_Transpose">
        /// <para>Fields to Transpose</para>
        /// <para><xdoc>
        ///   <para>The columns from the input table and the corresponding time values.</para>
        ///   <para>Multiple strings can be entered, depending on how many fields you are transposing. Each string should be formatted as "Field_Name Time" (without the quotation marks). Each is a pair of substrings separated by a space. For example, the following string is a valid input: "POP1980 1980". In this example, POP1980 is the field name of a field containing population values for 1980. 1980 is the string that will be substituted for POP1980 and populated in the time field of the output table or feature class.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入表中的列和相应的时间值。</para>
        ///   <para>可以输入多个字符串，具体取决于您转置的字段数。每个字符串的格式应为“Field_Name时间”（不带引号）。每个子字符串都是一对由空格分隔的子字符串。例如，以下字符串是有效输入：“POP1980 1980”。在此示例中，POP1980 是包含 1980 年人口值的字段的字段名称。1980 是将替换为 POP1980 并填充到输出表或要素类的时间字段中的字符串。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_Output_Feature_Class_or_Table">
        /// <para>Output Feature Class or Table</para>
        /// <para>The output feature class or table. The output table can be specified as a .dbf table, an info table, or a geodatabase table. The output feature class can only be stored in a geodatabase (shapefile is not available as a format for the output). The output feature class or table will contain a time field, a value field, and any number of attribute fields specified that need to be inherited from the input table.</para>
        /// <para>输出要素类或表。输出表可以指定为 .dbf 表、信息表或地理数据库表。输出要素类只能存储在地理数据库中（shapefile 不能用作输出格式）。输出要素类或表将包含时间字段、值字段以及指定了需要从输入表继承的任意数量的属性字段。</para>
        /// </param>
        /// <param name="_Time_Field_Name">
        /// <para>Time Field Name</para>
        /// <para>The name of the time field that will be created to store time values. The default name is "Time". Any valid field name can be used.</para>
        /// <para>将创建用于存储时间值的时间字段的名称。默认名称为“Time”。可以使用任何有效的字段名称。</para>
        /// </param>
        /// <param name="_Value_Field_Name">
        /// <para>Value Field Name</para>
        /// <para>The name of the value field that will be created to store the values from the input table. The default name is "Value". Any valid field name can be set, as long as it does not conflict with existing field names from the input table or feature class.</para>
        /// <para>将创建的值字段的名称，用于存储输入表中的值。默认名称为“Value”。可以设置任何有效的字段名称，只要它不与输入表或要素类中的现有字段名称冲突即可。</para>
        /// </param>
        public TransposeTimeFields(object _Input_Feature_Class_or_Table, List<object> _Fields_to_Transpose, object _Output_Feature_Class_or_Table, object _Time_Field_Name, object _Value_Field_Name)
        {
            this._Input_Feature_Class_or_Table = _Input_Feature_Class_or_Table;
            this._Fields_to_Transpose = _Fields_to_Transpose;
            this._Output_Feature_Class_or_Table = _Output_Feature_Class_or_Table;
            this._Time_Field_Name = _Time_Field_Name;
            this._Value_Field_Name = _Value_Field_Name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Transpose Time Fields";

        public override string CallName => "management.TransposeTimeFields";

        public override List<string> AcceptEnvironments => ["scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Feature_Class_or_Table, _Fields_to_Transpose, _Output_Feature_Class_or_Table, _Time_Field_Name, _Value_Field_Name, _Attribute_Fields];

        /// <summary>
        /// <para>Input Feature Class or Table</para>
        /// <para>The input feature class or table for which time stamps will be created.</para>
        /// <para>将为其创建时间戳的输入要素类或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Feature Class or Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Feature_Class_or_Table { get; set; }


        /// <summary>
        /// <para>Fields to Transpose</para>
        /// <para><xdoc>
        ///   <para>The columns from the input table and the corresponding time values.</para>
        ///   <para>Multiple strings can be entered, depending on how many fields you are transposing. Each string should be formatted as "Field_Name Time" (without the quotation marks). Each is a pair of substrings separated by a space. For example, the following string is a valid input: "POP1980 1980". In this example, POP1980 is the field name of a field containing population values for 1980. 1980 is the string that will be substituted for POP1980 and populated in the time field of the output table or feature class.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入表中的列和相应的时间值。</para>
        ///   <para>可以输入多个字符串，具体取决于您转置的字段数。每个字符串的格式应为“Field_Name时间”（不带引号）。每个子字符串都是一对由空格分隔的子字符串。例如，以下字符串是有效输入：“POP1980 1980”。在此示例中，POP1980 是包含 1980 年人口值的字段的字段名称。1980 是将替换为 POP1980 并填充到输出表或要素类的时间字段中的字符串。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fields to Transpose")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _Fields_to_Transpose { get; set; }


        /// <summary>
        /// <para>Output Feature Class or Table</para>
        /// <para>The output feature class or table. The output table can be specified as a .dbf table, an info table, or a geodatabase table. The output feature class can only be stored in a geodatabase (shapefile is not available as a format for the output). The output feature class or table will contain a time field, a value field, and any number of attribute fields specified that need to be inherited from the input table.</para>
        /// <para>输出要素类或表。输出表可以指定为 .dbf 表、信息表或地理数据库表。输出要素类只能存储在地理数据库中（shapefile 不能用作输出格式）。输出要素类或表将包含时间字段、值字段以及指定了需要从输入表继承的任意数量的属性字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class or Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Output_Feature_Class_or_Table { get; set; }


        /// <summary>
        /// <para>Time Field Name</para>
        /// <para>The name of the time field that will be created to store time values. The default name is "Time". Any valid field name can be used.</para>
        /// <para>将创建用于存储时间值的时间字段的名称。默认名称为“Time”。可以使用任何有效的字段名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Time_Field_Name { get; set; }


        /// <summary>
        /// <para>Value Field Name</para>
        /// <para>The name of the value field that will be created to store the values from the input table. The default name is "Value". Any valid field name can be set, as long as it does not conflict with existing field names from the input table or feature class.</para>
        /// <para>将创建的值字段的名称，用于存储输入表中的值。默认名称为“Value”。可以设置任何有效的字段名称，只要它不与输入表或要素类中的现有字段名称冲突即可。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Value_Field_Name { get; set; }


        /// <summary>
        /// <para>Attribute Fields</para>
        /// <para>Attribute fields from the input table to be included in the output table.</para>
        /// <para>要包含在输出表中的输入表中的属性字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _Attribute_Fields { get; set; } = null;


        public TransposeTimeFields SetEnv(object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}